#include"vector.h"


//int main()
//{
//	/*vector<string> vs{ "abc","def" };
//	cout << vs[0][1] << endl;
//	cout << vs[0].size() << endl;*/
//    string digits("23");
//    vector<string> vs{ "abc","def","ghi","jkl","mno","pqrs","tuv","wxyz" };
//    vector<string> v;
//    for (int i = 0; i < digits.size(); i++)
//    {
//        for (int j = 0; j < vs[digits[i]].length(); j++)
//        {
//            v[j] = vs[j - 2][i];
//        }
//    }
//
//	return 0;
//}

namespace bit
{
	void test_vector1()
	{
		vector<int> v1;
		v1.push_back(1);
		v1.push_back(1);
		v1.push_back(1);
		v1.push_back(1);
		v1.push_back(1);
		for (auto& e : v1)
		{
			cout << e << " ";
		}
		cout << endl;
		vector<int>::iterator it = v1.begin();
		while (it != v1.end())
		{
			cout << *it << " ";
			it++;
		}
		cout << endl;
		for (size_t i = 0; i < v1.size(); i++)
		{
			cout << v1[i] << " ";
		}
		cout << endl;
	}
	void test_vector2()
	{
		vector<int> v1;
		v1.push_back(1);
		v1.push_back(1);
		v1.push_back(1);
		v1.push_back(1);
		v1.push_back(1);

		vector<int> v2(10, 6);
		for (auto& e : v2)
		{
			cout << e << " ";
		}
		cout << endl;

		vector<int> v3(v2);
		for (auto& e : v3)
		{
			cout << e << " ";
		}
		cout << endl;
		v3 = v1;
		for (auto& e : v3)
		{
			cout << e << " ";
		}
		cout << endl;

	}
	void test_vector3()
	{
		vector<int> v1;
		v1.push_back(1);
		v1.push_back(2);
		v1.push_back(3);
		v1.push_back(4);
		v1.push_back(5);
		for (auto& e : v1)
		{
			cout << e << " ";
		}
		cout << endl;
		v1.pop_back();
		v1.pop_back();
		for (auto& e : v1)
		{
			cout << e << " ";
		}
		cout << endl;

		v1.erase(find(v1.begin(), v1.end(), 3));
		for (auto& e : v1)
		{
			cout << e << " ";
		}
		cout << endl;
		v1.erase(find(v1.begin(), v1.end(), 1));
		for (auto& e : v1)
		{
			cout << e << " ";
		}
		cout << endl;
	}
}

int main()
{
	bit::test_vector3();
	return 0;
}
